{extend name="public:index"/}
{block name="title"}{:sysconf('title')}{/block}
{block name="content"}
<!-- 	<section class="whtop youhtop">
		<div class="top">
			<p class="p1"><a href="javascript:history.back(-1)"></a></p>
			<p class="p2">我的优惠券</p>
			<p class="p3">编辑</p>
		</div>
	</section>
	<section style="height:2rem;"></section>
    <section class="swiper-container indlb">
        <div class="swiper-pagination"></div>
    </section>
    <section class="swiper-container1 ncnavbox">
        <div class="swiper-wrapper">
            <div class="swiper-slide">
				<ul class="yhul">
					{if condition="$list"}
					{foreach name="list" item="vo"}
					<li>
						<p class="p1 {if condition='$vo.status neq 0'}canp1{/if}">
							<em>￥<i>{$vo.coupon_money}</i></em><span>满{$vo.coupon_astrict}元</span>
						</p>
						<p class="p2">
							<b>有效期</b><em>满{$vo.coupon_astrict}元享受此优惠</em><span>{$vo['start_time']} - {$vo['end_time']}</span>
						</p>
						<p class="p3">
							{if condition='$vo.status eq 1'/}
							<em><img src="__INDEX__/images/quan3.png" alt=""></em><a class="cana" href="javascript:;">已使用</a>
							{elseif condition='$vo.status eq 2'/}
							<em><img src="__INDEX__/images/quan5.png" alt=""></em><a class="cana" href="javascript:;">已过期</a>
							{else/}
							<em><img src="__INDEX__/images/quan2.png" alt=""></em><a href="{:url('Goods/index')}">去使用</a>
							{/if}
							<i class="i1"></i>
							<i class="i2"></i>
						</p>
						<p class="p4" data-id="{$vo.id}">删除</p>
					</li>
					{/foreach}
					{else}
					<div class="nofind"><img src="__HOME__/images/noyhq.png" alt=""><p>暂时没有优惠券</p></div>
					{/if}
				</ul>
            </div>
            <div class="swiper-slide">
				<ul class="yhul">
					{if condition="$list1"}
					{foreach name="list1" item="vo"}
					<li>
						<p class="p1">
							<em>￥<i>{$vo.coupon_money}</i></em>
							<span>满{$vo.coupon_astrict}元</span>
						</p>
						<p class="p2">
							<b>有效期</b>
							<em>满{$vo.coupon_astrict}元享受此优惠</em>
							<span>
								{$vo['start_time']}-{$vo['end_time']}
							</span>
						</p>
						<p class="p3">
							<em><img src="__INDEX__/images/quan2.png" alt=""></em>
							<a href="{:url('Goods/index')}">去使用</a>
							<i class="i1"></i>
							<i class="i2"></i>
						</p>
						<p class="p4" data-id="{$vo.id}">删除</p>
					</li>
					{/foreach}
					{else}
					<div class="nofind"><img src="__INDEX__/images/noyhq.png" alt=""><p>暂时没有优惠券</p></div>
					{/if}
				</ul>
            </div>
            <div class="swiper-slide">
				<ul class="yhul">
					{if condition="$list2"}
					{foreach name="list2" item="vo"}
					<li>
						<p class="p1 canp1">
							<em>￥<i>{$vo.coupon_money}</i></em>
							<span>满{$vo.coupon_astrict}元</span>
						</p>
						<p class="p2">
							<b>有效期</b><em>满{$vo.coupon_astrict}元享受此优惠</em>
							<span>{$vo['start_time']}-{$vo['end_time']}</span>
						</p>
						<p class="p3">
							<em><img src="__INDEX__/images/quan3.png" alt=""></em><a class="cana" href="javascript:;">已使用</a>
							<i class="i1"></i>
							<i class="i2"></i>
						</p>
						<p class="p4" data-id="{$vo.id}">删除</p>
					</li>
					{/foreach}
					{else}
					<div class="nofind"><img src="__INDEX__/images/noyhq.png" alt=""><p>暂时没有优惠券</p></div>
					{/if}
				</ul>
            </div>
            <div class="swiper-slide">
				<ul class="yhul">
					{if condition="$list3"}
					{foreach name="list3" item="vo"}
					<li>
						<p class="p1 canp1">
							<em>￥<i>{$vo.coupon_money}</i></em>
							<span>满{$vo.coupon_astrict}元</span>
						</p>
						<p class="p2">
							<b>有效期</b><em>满{$vo.coupon_astrict}元享受此优惠</em>
							<span>{$vo['start_time']}-{$vo['end_time']}</span>
						</p>
						<p class="p3">
							<em><img src="__INDEX__/images/quan5.png" alt=""></em><a class="cana" href="javascript:;">已过期</a>
							<i class="i1"></i>
							<i class="i2"></i>
						</p>
						<p class="p4" data-id="{$vo.id}">删除</p>
					</li>
					{/foreach}
					{else}
					<div class="nofind"><img src="__INDEX__/images/noyhq.png" alt=""><p>暂时没有优惠券</p></div>
					{/if}
				</ul>
            </div>
        </div>
        <div class="swiper-pagination1 ncnav">
			<span>1</span>
			<span>2</span>
			<span>3</span>
			<span>4</span>
        </div>
		<div style="height:2.5rem;"></div>
    </section> -->

	<section class="whtop youhtop">
		<div class="top">
			<p class="p1"><a href="javascript:history.back(-1)"></a></p>
			<p class="p2">我的优惠券</p>
			<p class="p3">编辑</p>
		</div>
	</section>
	<section style="height:2rem;"></section>

    <section class="swiper-container1 ncnavbox">
        <div class="swiper-wrapper">
            <div class="swiper-slide" style="display:block;">
				<ul class="yhul">
					{if condition="$list"}
					{foreach name="list" item="vo"}
					<li>
						<p class="p1 {if condition='$vo.status neq 0'}canp1{/if}">
							<em>￥<i>{$vo.coupon_money}</i></em><span>满{$vo.coupon_astrict}元</span>
						</p>
						<p class="p2">
							<b>有效期</b><em>满{$vo.coupon_astrict}元享受此优惠</em><span>{$vo['start_time']} - {$vo['end_time']}</span>
						</p>
						<p class="p3">
							{if condition='$vo.status eq 1'/}
							<em><img src="__INDEX__/images/quan3.png" alt=""></em><a class="cana" href="javascript:;">已使用</a>
							{elseif condition='$vo.status eq 2'/}
							<em><img src="__INDEX__/images/quan5.png" alt=""></em><a class="cana" href="javascript:;">已过期</a>
							{else/}
							<em><img src="__INDEX__/images/quan2.png" alt=""></em><a href="{:url('Goods/index')}">去使用</a>
							{/if}
							<i class="i1"></i>
							<i class="i2"></i>
						</p>
						<p class="p4" data-id="{$vo.id}">删除</p>
					</li>
					{/foreach}
					{else}
					<div class="nofind"><img src="__INDEX__/images/noyhq.png" alt=""><p>暂时没有优惠券</p></div>
					{/if}
				</ul>
            </div>
            <div class="swiper-slide" style="display:none;">
				<ul class="yhul">
					{if condition="$list1"}
					{foreach name="list1" item="vo"}
					<li>
						<p class="p1">
							<em>￥<i>{$vo.coupon_money}</i></em>
							<span>满{$vo.coupon_astrict}元</span>
						</p>
						<p class="p2">
							<b>有效期</b>
							<em>满{$vo.coupon_astrict}元享受此优惠</em>
							<span>
								{$vo['start_time']}-{$vo['end_time']}
							</span>
						</p>
						<p class="p3">
							<em><img src="__INDEX__/images/quan2.png" alt=""></em>
							<a href="{:url('Goods/index')}">去使用</a>
							<i class="i1"></i>
							<i class="i2"></i>
						</p>
						<p class="p4" data-id="{$vo.id}">删除</p>
					</li>
					{/foreach}
					{else}
					<div class="nofind"><img src="__INDEX__/images/noyhq.png" alt=""><p>暂时没有优惠券</p></div>
					{/if}
				</ul>
            </div>
            <div class="swiper-slide" style="display:none;">
				<ul class="yhul">
					{if condition="$list2"}
					{foreach name="list2" item="vo"}
					<li>
						<p class="p1 canp1">
							<em>￥<i>{$vo.coupon_money}</i></em>
							<span>满{$vo.coupon_astrict}元</span>
						</p>
						<p class="p2">
							<b>有效期</b><em>满{$vo.coupon_astrict}元享受此优惠</em>
							<span>{$vo['start_time']}-{$vo['end_time']}</span>
						</p>
						<p class="p3">
							<em><img src="__INDEX__/images/quan3.png" alt=""></em><a class="cana" href="javascript:;">已使用</a>
							<i class="i1"></i>
							<i class="i2"></i>
						</p>
						<p class="p4" data-id="{$vo.id}">删除</p>
					</li>
					{/foreach}
					{else}
					<div class="nofind"><img src="__INDEX__/images/noyhq.png" alt=""><p>暂时没有优惠券</p></div>
					{/if}
				</ul>
            </div>
            <div class="swiper-slide" style="display:none;">
				<ul class="yhul">
					{if condition="$list3"}
					{foreach name="list3" item="vo"}
					<li>
						<p class="p1 canp1">
							<em>￥<i>{$vo.coupon_money}</i></em>
							<span>满{$vo.coupon_astrict}元</span>
						</p>
						<p class="p2">
							<b>有效期</b><em>满{$vo.coupon_astrict}元享受此优惠</em>
							<span>{$vo['start_time']}-{$vo['end_time']}</span>
						</p>
						<p class="p3">
							<em><img src="__INDEX__/images/quan5.png" alt=""></em><a class="cana" href="javascript:;">已过期</a>
							<i class="i1"></i>
							<i class="i2"></i>
						</p>
						<p class="p4" data-id="{$vo.id}">删除</p>
					</li>
					{/foreach}
					{else}
					<div class="nofind"><img src="__INDEX__/images/noyhq.png" alt=""><p>暂时没有优惠券</p></div>
					{/if}
				</ul>
            </div>
        </div>
        <div class="swiper-pagination1 ncnav" style="background-color:#fff;position:fixed;top:2rem;
        padding-right:0;width:16rem;z-index:99;">
			<span class="canspan">全部</span>
			<span>未使用</span>
			<span>已使用</span>
			<span>已过期</span>
        </div>
		<div style="height:2.5rem;"></div>
    </section>
    <style type="text/css">
		.canspan{border-bottom: 1px solid #ff0000;color: #ff0000;}

		.ncslide1{display: none;}
		.swiper-slide{display: none;height: auto!important}
    </style>
	<script type="text/javascript">

		    $('.ncnav span').click(function(){
		        var thi = $(this).index();
		        $(this).addClass('canspan').siblings().removeClass('canspan');
		        $('.swiper-slide').hide();
		        $('.swiper-wrapper .swiper-slide').eq(thi).css('display','block');
		    });

			window.onload=function(){
			  if (location.href.indexOf("?xyz=")<0)
			 {
			 location.href=location.href+"?xyz="+Math.random();
			 }
			}
		    $('.youhtop .p3').click(function(){
		    	if ($(this).hasClass('cap')) {
		    		$(this).removeClass('cap');
			    	$('.ncnavbox ul li').animate({'marginLeft':0},500);
			    	$('.ncnavbox ul li .p4').animate({'right':-3+'rem'},500);
			    	$(this).html('编辑');
		    	} else {
		    		$(this).addClass('cap');
			    	$('.ncnavbox ul li').animate({'marginLeft':-3+'rem'},500);
			    	$('.ncnavbox ul li .p4').animate({'right':0+'rem'},500);
			    	$(this).html('完成');
		    	}
		    });
		    $('.ncnavbox ul li .p4').click(function(){
				var obj = $(this);
				var id = obj.attr('data-id');
				$.ajax({
					url: "{:url('User/delCoupon')}",
					type: "POST",
					data: {'id':id},
					dataType: "JSON",
					success: function (data) {
						if (data.code == 0) {
							layer.msg(data.msg,{icon:6,time:500},function(){ obj.parent().remove();});
						} else {
							layer.msg(data.msg, { 'icon': 5 });
						}
					}
				});
		    });
		  //   var swiper = new Swiper('.swiper-container', {
		  //   	pagination: '.swiper-pagination',
		  //       paginationClickable: true,
		  //       centeredSlides: true,
		  //       autoplay: 2500,
		  //       autoplayDisableOnInteraction: false,
		  //   });
		  //   var swiper = new Swiper('.swiper-container1', {
		  //   	pagination: '.swiper-pagination1',
		  //       paginationClickable: true,
		  //       onSlideChangeStart: function() {
		  //       	var hri1 = $('.ncnavbox .swiper-slide').eq(swiper.activeIndex).children('.yhul').height()+20;
   	// 					$('.ncnavbox').css('height',hri1);
				// }
		  //   });
	</script>
{/block}